<section class="widget">
    <div style="background-color:#262627; background-image:url(/themes/blog/images/bj.jpg);background-size:100% "
            class="widget-tops" id="user-tool">
        <h4 style=" color:#fff">
            {% if user.isLogin() === false %}
                需要登录才能进入会员中心
            {% else %}
                {{ user.name }}，现在是早上。
                <a href="{{ url(['for':'logout']) }}">登出</a>
            {% endif %}
        </h4>
        <p>
            {% if user.isLogin() !== true %}
                <a class="btn btn-primary signin-loader" href="{{ url(['for':'login']) }}">立即登录</a>
                <a class="btn btn-default signup-loader" href="{{ url(['for':'register']) }}">现在注册</a>
            {% else %}
                <a class="btn btn-primary signin-loader" href="#">用户中心</a>
                {% if user.isAdmin() == true %}
                    <a class="btn btn-default signup-loader" href="{{ url(['for':'adminFrame']) }}">管理后台</a>
                {% endif %}
            {% endif %}
        </p>
    </div>
</section>
<section id="search-2" class="widget widget_search">
    {{ view.r(formRender('search.searchForm')) }}
</section>
<section class="widget">
    <h3 class="widget-title"><span class="cat">最新文章</span></h3>
    <div class="list-group node-list">
         {% for item in entityList('node',['limit':7]) %}
        <a target="_blank" title="{{ item.title }}" href="{{ url(['for':'node','id':item.id]) }}">
            <div class="time">
                <span class="r">{{ date('d',item.changed) }}</span>/
                <span class="y">{{ date('m',item.changed) }}月</span>
            </div>
            <div class="node">{{ item.title }}</div>
        </a>
    {% endfor %}
    </div>
</section>
<section class="widget">
    <h3 class="widget-title"><span class="cat">最近评论</span></h3>
    <div class="list-group comment-list">
         {% for item in entityList('comment',['limit':7]) %}
        <a target="_blank" title="{{ item.node.title }}" href="{{ url(['for':'node','id':item.nid]) }}">
            <img alt="{{ item.user.name }}"
                    src="http://vince.qiniudn.com/wp-content/uploads/2016/04/Screenshot.png?imageView2/2/w/400/h/200">
            <p><strong>{{ item.user.name }}：</strong>{{ item.body }}</p>
        </a>
    {% endfor %}
    </div>
</section>
<section class="widget">
    <h3 class="widget-title"><span class="cat">分类导航</span></h3>
    <div class="term-list">
         {% for item in termList(15) %}
        <a target="_blank" title="{{ item.name }}" href="{{ url(['for':'term','id':item.id,'page':1]) }}">{{ item.name }}</a>
        {% endfor %}
    </div>
</section>
